import { z } from 'zod';

// 联麓SMS连接器配置验证规则
export const SmsConfigGuard = z.object({
  MchId: z.string(),
  AppId: z.string(),
  AppKey: z.string(),
  Version: z.string(),
  Templates: z
    .array(
      z.object({
        usageType: z.string(),
        templateCode: z.string(),
      })
    )
    .refine(
      (templates) => templates.some((template) => template.usageType === 'Generic'),
      'Templates should provide Generic template.'
    ),
});
export type ShlianluSmsConfig = z.infer<typeof SmsConfigGuard>;

// 联麓SMS连接器响应验证规则
export const shlianluResponse = z.object({
  status: z.string(),
  taskId: z.string(),
  timestamp: z.string(),
  message: z.string(),
  count: z.number().int(),
});
export declare type ShlianluResponse = z.infer<typeof shlianluResponse>;
